﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace K_Means
{

	public partial class IgnoreAttributes : Form
	{
		public event EventHandler<ChangeIgnoreAtrributesEventArgs> ChangeIgnoreAttributes;
		public string[] Attributes { get; set; }
		
		public IgnoreAttributes()
		{
			InitializeComponent();
		}

		private void IgnoreAttributes_Load(object sender, EventArgs e)
		{
			for (int i = 0; i < this.Attributes.Length; i++)
			{
				this._lvAttributes.Items.Add(new ListViewItem(new string[] { "", this.Attributes[i] }));
			}
		}

		private void _btnOK_Click(object sender, EventArgs e)
		{
			List<int> attributes = new List<int>();
			for (int i = 0; i < this._lvAttributes.CheckedItems.Count; i++)
			{
				attributes.Add(this._lvAttributes.CheckedItems[i].Index);
			}
			ChangeIgnoreAttributes(this, new ChangeIgnoreAtrributesEventArgs() { Atrributes = attributes });
			this.DialogResult = DialogResult.OK;
		}

		private void _btnCancel_Click(object sender, EventArgs e)
		{
			this.DialogResult = DialogResult.Cancel;
		}
	}
}
